<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="d" uri="http://dgg.net/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>

<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt_rt" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>生产订单详情基础信息</title>
    <c:import url="../../header.jsp"/>
    <style>
        .productDataClass{
            background: #dadada;
        }
        .line2 {
            min-width: 120px;
            max-width: 200px;
        }
    </style>
</head>

<body>
<input type="hidden" id="scOrderId" value="${resultMap.baseInfo.id}">
<input type="hidden" id="orderBusNo" value="${resultMap.baseInfo.orderBusNo}">
<input type="hidden" id="ordertypeId" value="${resultMap.baseInfo.businessTypeId}">
<input type="hidden" id="beforeTableName" value="${beforeTableName}">
<input type="hidden" id="beforeTableUrl" value="${beforeTableUrl}">
<div class="body-main">
    <!--订单扼要信息 start-->
    <div class="business-top" id="div_orderInfo">
        <ul class="business-info">
            <input type="hidden" name="customerName" value="">
            <li><b>生产订单编号：</b>${resultMap.baseInfo.scProductOrderNo}</li>
            <li><b>所属订单：</b>${resultMap.baseInfo.orderNo}</li>
            <li><b>生产状态：</b>${resultMap.baseInfo.status}</li>
            <li><b>客户：</b>${resultMap.baseInfo.customerName}&nbsp;
                <span>${resultMap.baseInfo.customerPhone}</span>
<c:if test="${type == 0}">
                <d:hasUrlAuth authCode="ZZSC_SEE_PHONE">
                    <a href="javascript:void(0)" class="opt-icon look"
                       onclick="seeNumber(this,'${resultMap.baseInfo.id}','2','1')"></a>
                </d:hasUrlAuth>
</c:if>
                <c:if test="${type == 0}">
                 <a href="javascript:void(0)" class="opt-icon-a icon1" onclick="callPhoneByProduction('${resultMap.baseInfo.id}')"></a></li>
            </c:if>
            <li><b>当前流程人员：</b>${resultMap.baseInfo.flowUserName}</li>
            <li><b>生产单负责人：</b>${resultMap.baseInfo.productUserName}</li>
            <li><b>签单商务：</b>${resultMap.baseInfo.signUserName}</li>
            <li><b>证书匹配：</b>${resultMap.cerdentialStatus.zsStatusName}</li>
            <li><b>资质匹配：</b>${resultMap.cerdentialStatus.zzStatusName}</li>
            <li><b>订单备注：</b>${resultMap.baseInfo.remark}</li>
            <li><b>企管家：</b><span id="qgjUser">--</span></li>
        </ul>
    </div>
    <!--订单扼要信息 end-->

    <!--订单操作按钮 start-->
    <div class="business-opt">
        <%--产品为收证的不能操作--%>
        <c:if test="${type == 0}">
        <c:if test="${resultMap.baseInfo.businessProductCode != 'BUS_YT_ZZ_ZS'}">
        <c:if test="${resultMap.baseInfo.oldStatus == 'ZZSC_STATE_SCPROORDER_CODE6'}">
            <d:hasUrlAuth authCode="ZZSC_DETAIL_UPDATENODE">
                <a href="javascript:void(0)" onclick="openUpdateNode('','${resultMap.baseInfo.id}')"
                   class="layui-btn layui-btn-mini" btnauthCode="ZZSC_DETAIL_UPDATENODE">更新节点</a>
            </d:hasUrlAuth>
        </c:if>
        <c:if test="${resultMap.baseInfo.oldStatus == 'ZZSC_STATE_SCPROORDER_CODE6'}">
            <d:hasUrlAuth authCode="ZZSC_DETAIL_SUSPEND">
                <a href="javascript:void(0)" onclick="suspendOrder('','${resultMap.baseInfo.id}')"
                   class="layui-btn layui-btn-mini" btnauthCode="ZZSC_DETAIL_SUSPEND">生产暂停</a>
            </d:hasUrlAuth>
        </c:if>
        <c:if test="${resultMap.baseInfo.oldStatus == 'ZZSC_STATE_SCPROORDER_CODE6'}">
            <d:hasUrlAuth authCode="ZZSC_DETAIL_ADD_ASSIST">
                <a href="javascript:void(0)" onclick="addAssist('','${resultMap.baseInfo.id}')"
                   class="layui-btn layui-btn-mini" btnauthCode="ZZSC_DETAIL_ADD_ASSIST">添加协单人员</a>
            </d:hasUrlAuth>
        </c:if>
        <c:if test="${resultMap.baseInfo.oldStatus != 'ZZSC_STATE_SCPROORDER_CODE2' && resultMap.baseInfo.oldStatus != 'ZZSC_STATE_SCPROORDER_CODE3' && resultMap.baseInfo.oldStatus != 'ZZSC_STATE_SCPROORDER_CODE7'
    && resultMap.baseInfo.oldStatus != 'ZZSC_STATE_SCPROORDER_CODE4' && resultMap.baseInfo.oldStatus != 'ZZSC_STATE_SCPROORDER_CODE5'
    && resultMap.baseInfo.oldStatus != 'ZZSC_STATE_SCPROORDER_CODE8' && resultMap.baseInfo.oldStatus != 'ZZSC_STATE_SCPROORDER_CODE9'
    && resultMap.baseInfo.oldStatus != 'ZZSC_STATE_SCPROORDER_CODE10' && resultMap.baseInfo.oldStatus != 'ZZSC_STATE_SCPROORDER_CODE15'}">
            <d:hasUrlAuth authCode="ZZSC_DETAIL_CHARGE_BACK">
                <a href="javascript:void(0)" onclick="chargeBackOrder('','${resultMap.baseInfo.id}')"
                   class="layui-btn layui-btn-mini" btnauthCode="ZZSC_DETAIL_CHARGE_BACK">退单</a>
            </d:hasUrlAuth>
        </c:if>
        <c:if test="${resultMap.baseInfo.oldStatus != 'ZZSC_STATE_SCPROORDER_CODE10'}">
            <d:hasUrlAuth authCode="ZZSC_DETAIL_CERTIFICATE_MATCH">
                <a href="javascript:void(0)" class="layui-btn layui-btn-mini"
                   onclick="certificateMatch('','${resultMap.baseInfo.id}')"
                   btnauthCode="ZZSC_DETAIL_CERTIFICATE_MATCH">证书匹配</a>
            </d:hasUrlAuth>
        </c:if>
        <c:if test="${resultMap.baseInfo.oldStatus != 'ZZSC_STATE_SCPROORDER_CODE10'}">
            <d:hasUrlAuth authCode="ZZSC_DETAIL_QUALIFICATION_MATCH">
                <a href="javascript:void(0)" class="layui-btn layui-btn-mini"
                   onclick="qualificationMatch('','${resultMap.baseInfo.id}')"
                   btnauthCode="ZZSC_DETAIL_QUALIFICATION_MATCH">资质匹配</a>
            </d:hasUrlAuth>
        </c:if>
        <c:if test="${resultMap.baseInfo.oldStatus == 'ZZSC_STATE_SCPROORDER_CODE6'}">
            <d:hasUrlAuth authCode="ZZSC_DETAIL_PAY_MONEY">
                <a href="javascript:void(0)" class="layui-btn layui-btn-mini" btnauthCode="ZZSC_DETAIL_PAY_MONEY"
                   onclick="applyMoneyProduct('','${resultMap.baseInfo.orderBusNo}','${resultMap.baseInfo.orderBusId}')">费用申请</a>
            </d:hasUrlAuth>
        </c:if>
        <%--<d:hasUrlAuth authCode="ZZSC_DETAIL_BIND_FILES">--%>
        <%--<a href="javascript:void(0)" class="layui-btn layui-btn-mini" btnauthCode="ZZSC_DETAIL_BIND_FILES"--%>
        <%--onclick="bindFiles('','${resultMap.baseInfo.id}','${resultMap.baseInfo.scProductOrderNo}')">档案绑定</a>--%>
        <%--</d:hasUrlAuth>--%>
        <c:if test="${resultMap.baseInfo.oldStatus != 'ZZSC_STATE_SCPROORDER_CODE1' && resultMap.baseInfo.oldStatus != 'ZZSC_STATE_SCPROORDER_CODE14'
    && resultMap.baseInfo.oldStatus != 'ZZSC_STATE_SCPROORDER_CODE8' && resultMap.baseInfo.oldStatus != 'ZZSC_STATE_SCPROORDER_CODE9'
    && resultMap.baseInfo.oldStatus != 'ZZSC_STATE_SCPROORDER_CODE10' && resultMap.baseInfo.oldStatus != 'ZZSC_STATE_SCPROORDER_CODE11'
     && resultMap.baseInfo.oldStatus != 'ZZSC_STATE_SCPROORDER_CODE12'  && resultMap.baseInfo.oldStatus != 'ZZSC_STATE_SCPROORDER_CODE13'
      && resultMap.baseInfo.oldStatus != 'ZZSC_STATE_SCPROORDER_CODE15'}">
            <d:hasUrlAuth authCode="ZZSC_DETAIL_TRANSFER_ORDER">
                <a href="javascript:void(0)" class="layui-btn layui-btn-mini"
                   onclick="transferOrderAjaxSubmit('','${resultMap.baseInfo.id}')"
                   btnauthCode="ZZSC_DETAIL_TRANSFER_ORDER">转单</a>
            </d:hasUrlAuth>
        </c:if>
            <%--待分配不能移交--%>
        <c:if test="${resultMap.baseInfo.oldStatus != 'ZZSC_STATE_SCPROORDER_CODE1' && resultMap.baseInfo.oldStatus != 'ZZSC_STATE_SCPROORDER_CODE14'}">
        <d:hasUrlAuth authCode="ZZSC_DETAIL_TURN_OVER">
            <a href="javascript:void(0)" class="layui-btn layui-btn-mini"
               onclick="turnoverProductOrder('','${resultMap.baseInfo.id}')" btnauthCode="ZZSC_DETAIL_TURN_OVER">移交</a>
        </d:hasUrlAuth>
            </c:if>
        </c:if>
        <d:hasUrlAuth authCode="GDZX_SAVA_WORK_ORDER">
            <c:if test="${resultMap.baseInfo.oldStatus == 'ZZSC_STATE_SCPROORDER_CODE6'}">
                <a href="javascript:void(0)" class="layui-btn layui-btn-mini"
                   onclick="createWorkOrderInfo('${resultMap.baseInfo.id}','${resultMap.baseInfo.scProductOrderNo}','${resultMap.baseInfo.customerId}',scGdzxApiUrl+'/gdzx/workOrder/addWorkOrderPage.html')" >创建外勤工单</a>
            </c:if>
        </d:hasUrlAuth>
            <d:hasUrlAuth authCode="ZC_ZCSC_BTN_CODE60">
                <%--<c:if test="${resultMap.baseInfo.oldStatus == 'ZZSC_STATE_SCPROORDER_CODE6'}">--%>
                    <a href="javascript:void(0)" class="layui-btn layui-btn-mini"
                       onclick="openCreateWorkQgjOrderPage('${resultMap.baseInfo.customerId}','${resultMap.baseInfo.customerNo}','${resultMap.baseInfo.customerName}','${resultMap.baseInfo.encryptionPhone}'
                               ,'${resultMap.baseInfo.businessTypeCode}','${resultMap.baseInfo.id}','${resultMap.baseInfo.scProductOrderNo}')" >创建客服工单</a>
                <%--</c:if>--%>
            </d:hasUrlAuth>
        </c:if>
            <a href="javascript:void(0)" class="layui-btn layui-btn-mini" onclick="openRemark('${resultMap.baseInfo.customerId}')">备注详情</a>
    </div>
    <!--订单操作按钮 end-->

    <!-- 退废单操作记录 start-->
    <c:if test="${not empty resultMap.abandonRecordList}">
        <div class="finan-panel">
            <div class="finan-tit">
                <b>申请审核记录</b>
            </div>
            <div class="panel-main">
                <ul class="next-follow">
                    <c:forEach var="abandonRecord" items="${resultMap.abandonRecordList}">
                    <li>
                        <span>${abandonRecord.operaterName}</span>
                        <c:if test="${abandonRecord.operateType == 19}"><span class="label label-blue">申请退单</span> </c:if>
                        <c:if test="${abandonRecord.operateType == 46}"><span class="label">退单审核通过</span> </c:if>
                        <c:if test="${abandonRecord.operateType == 47}"><span class="label  label-red">退单审核驳回</span> </c:if>
                        <span class="time"><fmt:formatDate value="${abandonRecord.operateTime}" pattern="yyyy-MM-dd HH:mm:ss"/></span>
                        <span>备注：&nbsp;&nbsp;${abandonRecord.remarks}</span>
                    </li>
                    </c:forEach>
                </ul>
            </div>
        </div>
    </c:if>
    <!-- 退废单操作记录 end -->



    <%--基本信息 start--%>
    <div class="finan-panel">
        <div class="finan-tit">
            <b>基础信息</b>
            <div class="panel-opt">
            </div>
        </div>
        <div class="panel-table">
            <form id="cus_detail_form">
                <table class="layui-table table-info">
                    <tbody>
                    <tr>
                        <th>客户名称：</th>
                        <td>
                            <p>${resultMap.customerDTO.name}</p>
                        </td>
                        <th>联系电话：</th>
                        <td>
                            <input type="hidden" id="cusPhone" value="${resultMap.customerDTO.number}"/>
                            <p id="hiddenNumber" style="display:inline-block"></p>
                            <c:if test="${type == 0}">
                            <d:hasUrlAuth authCode="ZZSC_SEE_PHONE">
                                <a href="javascript:void(0)" class="opt-icon look"
                                   onclick="seeNumber(this,'${resultMap.customerDTO.id}','2','2')"></a>
                            </d:hasUrlAuth>
                            </c:if>
                            <c:if test="${type == 0}">
                            <c:if test="${not empty resultMap.customerDTO.number}">
                                <a href="javascript:void(0)" class="opt-icon-a icon1"
                                   onclick="callPhoneByCustomer('${resultMap.customerDTO.id}','${resultMap.customerDTO.name}')"></a>
                            </c:if>
                            </c:if>
                        </td>
                        <th>性别：</th>
                        <td>${resultMap.customerDTO.sex}</td>
                        <th>生日：</th>
                        <td>${resultMap.customerDTO.birthday}</td>
                    </tr>
                    <tr>
                        <th>身份证号码：</th>
                        <td>
                            <span>
                                <c:if test="${fn:length(resultMap.customerDTO.idCard) == 18}">
                                    ${fn:substring(resultMap.customerDTO.idCard,0,1)}********${fn:substring(resultMap.customerDTO.idCard,fn:length(resultMap.customerDTO.idCard)-1,fn:length(resultMap.customerDTO.idCard))}
                                </c:if>
                            </span>
                            <d:hasUrlAuth authCode="ZZSC_SEE_ID_CARD">
                                <a href="javascript:void(0)" class="opt-icon look"
                                   onclick="seeNumber(this,'${resultMap.customerDTO.idCard}','1','2')"></a>
                            </d:hasUrlAuth>
                        </td>
                        <th>户籍地址：</th>
                        <td>${resultMap.customerDTO.houseRegister}</td>
                        <th>客户年龄：</th>
                        <td>${resultMap.customerDTO.age}</td>
                        <th>业务地区：</th>
                        <td><span>${resultMap.customerDTO.businessArea}</span></td>
                    </tr>
                    <tr>
                        <th>客户角色：</th>
                        <td>${resultMap.customerDTO.customerType}</td>
                        <th>来源方式：</th>
                        <td>${resultMap.customerDTO.origin}</td>
                    </tr>
                    <%--<tr>
                        <th>客户备注：</th>
                        <td colspan="7">${resultMap.customerDTO.lastFollowContent}</td>
                    </tr>中台不存储客户备注了--%>
                    </tbody>
                </table>
            </form>
        </div>
    </div>

    <div class="finan-panel">
        <div class="panel-table">
            <table class="layui-table text-center">
                <thead>
                <tr>
                    <th>产品类型</th>
                    <th>订单产品</th>
                    <th>服务区域</th>
                    <th>产品属性</th>
                    <th>订单备注</th>
                    <th>合同编号</th>
                    <th>合同周期</th>
                </tr>
                </thead>
                <tbody>
                    <tr>
                        <td>${resultMap.baseInfo.businessProductName}</td><!--产品类型-->
                        <td>${resultMap.baseInfo.productName}</td><!--订单产品-->
                        <td>${resultMap.baseInfo.serviceArea}</td><!--服务区域-->
                        <td class="line2" title="${resultMap.baseInfo.productAttr}">${resultMap.baseInfo.productAttr}</td><!--产品属性-->
                        <td>
                            <c:if test="${fn:length(resultMap.baseInfo.orderRemark) >= 10}">
                                <div title="${resultMap.baseInfo.orderRemark}">${fn:substring(resultMap.baseInfo.orderRemark,0,10)}...</div>
                            </c:if>
                            <c:if test="${fn:length(resultMap.baseInfo.orderRemark) < 10}">
                                ${resultMap.baseInfo.orderRemark}
                            </c:if>
                        </td><!--产品备注-->
                        <td>${resultMap.baseInfo.contractNo}</td><!--合同编号-->
                        <td>${resultMap.baseInfo.contractStartDate} - ${resultMap.baseInfo.contractEndDate}</td><!--合同周期-->
                    </tr>
                </tbody>
            </table>
        </div>
    </div>
    <%--基本信息 end--%>
    <!--证书匹配 start-->
    <c:if test="${resultMap.baseInfo.isMatching == 1}">
        <div class="finan-panel">
            <div class="panel-table">
                <table class="layui-table text-center">
                    <thead style="color: black">
                    <th>所需证书</th>
                    <th>预匹配证书</th>
                    <th>实际匹配证书</th>
                    </thead>
                    <tbody>
                        <c:forEach items="${resultMap.matchCertificates}" var="matchCertificate" varStatus="index">
                            <tr style="height: 100px">
                                <td style="width: 40%;color: black">
                                    <span>${matchCertificate.underOrder.certificateType}/${matchCertificate.underOrder.certificateSpecialty}/${matchCertificate.underOrder.certificateLevelName}</span><br />
                                    <span><c:if test="${matchCertificate.underOrder.isSocialSecurity == 1}">不</c:if>需要社保/${matchCertificate.underOrder.socialSecurityArea}</span><br />
                                    <span><c:if test="${matchCertificate.underOrder.isNeedOriginal == 1}">不</c:if>需要人才原件配合/<c:if test="${matchCertificate.underOrder.isNeedAppearance == 1}">不</c:if>需要人才出场配合</span><br />
                                    <span>数量${matchCertificate.underOrder.count}本</span>
                                    <input type="hidden" name="tr1d1${index.index}" value="${matchCertificate.underOrder.certificateType}">
                                    <input type="hidden" name="tr1d2${index.index}" value='${matchCertificate.underOrder.certificateSpecialty}'>
                                    <input type="hidden" name="tr1d3${index.index}" value="${matchCertificate.underOrder.certificateLevelName}">
                                    <input type="hidden" name="tr2d1${index.index}" value="${matchCertificate.underOrder.isSocialSecurity == 1}">
                                    <input type="hidden" name="tr2d2${index.index}" value="${matchCertificate.underOrder.socialSecurityArea}">
                                    <input type="hidden" name="tr3d1${index.index}" value="${matchCertificate.underOrder.isNeedOriginal == 1}">
                                    <input type="hidden" name="tr3d2${index.index}" value="${matchCertificate.underOrder.isNeedAppearance == 1}">
                                    <input type="hidden" name="tr4d1${index.index}" value="${matchCertificate.underOrder.count}">
                                </td>
                                <td style="width: 30%">
                                    <c:if test="${matchCertificate.toMatch == 'ppjs'}">
                                        <img src="${pageContext.request.contextPath}/static/images/certificate/matchEnd.png">
                                    </c:if>
                                    <c:if test="${matchCertificate.toMatch != 'ppjs' && empty matchCertificate.toMatch}" >
                                        <img src="${pageContext.request.contextPath}/static/images/certificate/matchFailure.png">
                                    </c:if>
                                    <c:if test="${matchCertificate.toMatch != 'ppjs' && !empty matchCertificate.toMatch}" >
                                        <input type="hidden" name="certificateTypeId${index.index}" value="${matchCertificate.underOrder.certificateTypeId}">
                                        <input type="hidden" name="certificateSpecialtyId${index.index}" value='${matchCertificate.underOrder.certificateSpecialtyId}'>
                                        <input type="hidden" name="certificateLevel${index.index}" value="${matchCertificate.underOrder.certificateLevel}">
                                        <input type="hidden" name="isSocialSecurity${index.index}" value="${matchCertificate.underOrder.isSocialSecurity}">
                                        <input type="hidden" name="socialSecurityAreaId${index.index}" value="${matchCertificate.underOrder.socialSecurityAreaId}">
                                        <div style="float: right"><a href="javascript:void(0)" onclick="openAdvanceMatchingResult(this,${index.index})">更多</a></div><br/>
                                        <c:forEach items="${matchCertificate.toMatch}" var="toMatch">
                                            <li>
                                                <a href="javascript:void(0);" class="layui-table-link" onclick="credentialDetail('${toMatch.certificateNo}','${toMatch.id}')">${toMatch.certificateNo}</a>/${toMatch.personalName}/${toMatch.personalPhone}
                                                <a href="javascript:void(0)" class="layui-btn layui-btn-mini" onclick="advanceMatchingResult('${toMatch.id}','${toMatch.certificateNo}','${scOrderId}','${toMatch.id}')">配证</a>
                                            </li>
                                        </c:forEach>
                                    </c:if>

                                </td>
                                <td style="width: 30%">
                                    <c:if test="${!empty matchCertificate.theMatched}">
                                        <c:forEach items="${matchCertificate.theMatched}" var="baseCredential">
                                            <div>
                                                ${baseCredential.certificateNo}/${baseCredential.personalName}
                                            </div>
                                        </c:forEach>
                                    </c:if>
                                </td>
                            </tr>
                        </c:forEach>
                    </tbody>
                </table>
            </div>
        </div>
    </c:if>
    <!--证书匹配 end-->

    <%--生产数据 start--%>
    <div class="finan-panel">
        <div class="finan-tit">
            <b>生产数据</b>（生产订单到期时间：${resultMap.baseInfo.fomatOrderEndTime}）
            <c:if test="${resultMap.baseInfo.status != '强制完结' && resultMap.baseInfo.status != '结项' && resultMap.baseInfo.status != '生产完结'}">
                下一 节点：   ${resultMap.nextNodeInfo.nodeName }  &nbsp | &nbsp 到期时间：  <fmt:formatDate value="${resultMap.nextNodeInfo.nodeEndTime}" pattern="yyyy-MM-dd"/>
            </c:if>
            <div class="panel-opt">
                <div class="layui-inline">
                    <ul class="order-state">
                        <li><i class="state-circle"></i><span class="inline">已完成</span></li>
                        <li><i class="state-circle over"></i><span class="inline">已超期</span></li>
                        <li><i class="state-circle unfinished"></i><span class="inline">未完成</span></li>
                    </ul>
                </div>
<c:if test="${type == 0}">
                <d:hasUrlAuth authCode="ZZSC_DETAIL_EDIT">
                    <a href="javascript:void(0)" class="layui-btn layui-btn-mini" id="editProductOrder"
                       onclick="editProductOrder()">编辑</a>
                    <a href="javascript:void(0)" class="layui-btn layui-btn-mini none" id="saveProductOrder"
                       onclick="saveProductOrder()">保存</a>
                </d:hasUrlAuth>
</c:if>
            </div>
        </div>
        <div class="panel-body dis-block">
            <div class="flow flow-box">
                <ul class="flow-list flow-ul">
                    <c:forEach items="${resultMap.nodelist}" var="node">
                        <li>
                            <p style="font-color:red;height:17px;"> <c:if test="${node.nodeTimeStatus == 'OVERDUE_STATE2' && null !=resultMap.baseInfo.flowContent}">超期${node.days}天</c:if>
                                <c:if test="${resultMap.baseInfo.status == '强制完结' && node.nodeName == '完结'}">强制完结</c:if>
                            </p>
                            <i class="state-circle
                                <c:if test="${node.nodeTimeStatus == null || '' == node.nodeTimeStatus}">unfinished</c:if>
                                <c:if test="${node.nodeTimeStatus == 'OVERDUE_STATE2' || node.status==0}">over</c:if>
                                <c:if test="${resultMap.baseInfo.status == '强制完结' && node.nodeName == '完结'}">over</c:if>
                            "></i>
                            <p>${node.nodeName}${node.name}<c:if test="${node.status==0}">不通过</c:if></p>
                            <span>
                                 <p> <fmt:formatDate value="${node.nodeOpetateTime}" pattern="yyyy-MM-dd"/></p>
                                <p>${node.flowUserName}</p>
                                <p> ${node.flowOrgName}</p>
                            </span>
                        </li>
                    </c:forEach>
                    <c:forEach items="${resultMap.nextlist}" var="nextNode">
                        <li>
                            <p style="font-color:red;height:17px;"> </p>
                            <i class="state-circle unfinished "></i>
                            <p>${nextNode.name}</p>
                        </li>
                    </c:forEach>
                </ul>
            </div>
            <form id="productData">
                <input type="hidden" name="productOrderDataId" id="productOrderDataId" value="${resultMap.baseInfo.productOrderDataId}">
                <%--每个业态单独的数据  其他通用 start--%>
                <table class="layui-table table-info" id="productDataCom">
                    <tbody>
                    <tr>
                        <th>接收时间</th>
                        <td>
                            <span>&nbsp;${resultMap.baseInfo.receiveTime}</span>
                        </td>
                        <th>产品</th>
                        <td>
                            <span>&nbsp;${resultMap.baseInfo.productName}</span>
                        </td>
                        <th>渠道</th>
                        <td>
                            <input type="text" class="table-input productDataClass" name="channelName" maxlength="200"
                                   value="${resultMap.baseInfo.channelName}" readonly/>
                        </td>
                        <th>资料交接数</th>
                        <td>
                            <input type="text" class="table-input productDataClass" name="dataTransferNum" maxlength="200"
                                   value="${resultMap.baseInfo.dataTransferNum}" readonly/>
                        </td>
                    </tr>
                    <tr>
                        <th>资质公司</th>
                        <td>
                            <input type="text" class="table-input productDataClass" name="company" maxlength="200" value="${resultMap.baseInfo.company}"
                                   readonly/>
                        </td>
                        <th>招标文件</th>
                        <td>
                            <input type="text" class="table-input productDataClass" name="biddingDocuments" maxlength="200"
                                   value="${resultMap.baseInfo.biddingDocuments}" readonly/>
                        </td>
                        <th>招标清单</th>
                        <td>
                            <input type="text" class="table-input productDataClass" name="biddingList" maxlength="200"
                                   value="${resultMap.baseInfo.biddingList}" readonly/>
                        </td>
                        <th>标书数量</th>
                        <td>
                            <input type="text" class="table-input productDataClass" name="bidingNum" maxlength="200"
                                   value="${resultMap.baseInfo.bidingNum}" readonly/>
                        </td>
                    </tr>
                    <tr>
                        <th>网上审批时间</th>
                        <td>
                            <input type="text" disabled class="table-input Wdate" name="netApprovalTime"
                                   value="${resultMap.baseInfo.netApprovalTime}" autocomplete="off"
                                   onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})">
                        </td>
                        <th>评审时间</th>
                        <td>
                            <input type="text" disabled class="table-input Wdate" name="reviewTime"
                                   value="${resultMap.baseInfo.reviewTime}" autocomplete="off"
                                   onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})">
                        </td>
                        <th>评审结果</th>
                        <td>
                            <input type="text" class="table-input productDataClass" name="reviewResult" maxlength="200"
                                   value="${resultMap.baseInfo.reviewResult}" readonly/>
                        </td>
                        <th>报名时间</th>
                        <td>
                            <input type="text" disabled class="table-input Wdate" name="signupTime"
                                   value="${resultMap.baseInfo.signupTime}" autocomplete="off"
                                   onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})">
                        </td>
                    </tr>
                    <tr>
                        <th>换证时间</th>
                        <td>
                            <input type="text" disabled class="table-input Wdate" name="replacementTime"
                                   value="${resultMap.baseInfo.replacementTime}" autocomplete="off"
                                   onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})">
                        </td>
                        <th>打证时间</th>
                        <td>
                            <input type="text" disabled class="table-input Wdate" name="playingcardsTime"
                                   value="${resultMap.baseInfo.playingcardsTime}" autocomplete="off"
                                   onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})">
                        </td>
                        <th>交标书时间</th>
                        <td>
                            <input type="text" disabled class="table-input Wdate" name="handoveBidingTime"
                                   value="${resultMap.baseInfo.handoveBidingTime}" autocomplete="off"
                                   onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})">
                        </td>
                        <th>审批通告时间</th>
                        <td>
                            <input type="text" disabled class="table-input Wdate" name="approvalNoticeTime"
                                   value="${resultMap.baseInfo.approvalNoticeTime}" autocomplete="off"
                                   onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})">
                        </td>
                    </tr>
                    <tr>
                        <th>公示时间</th>
                        <td>
                            <input type="text" disabled class="table-input Wdate" name="publicityTime"
                                   value="${resultMap.baseInfo.publicityTime}" autocomplete="off"
                                   onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})">
                        </td>
                        <th>公示号</th>
                        <td>
                            <input type="text" class="table-input productDataClass" name="publicityNum" maxlength="200"
                                   value="${resultMap.baseInfo.publicityNum}" readonly/>
                        </td>
                        <th>公告时间</th>
                        <td>
                            <input type="text" disabled class="table-input Wdate" name="noticeTime"
                                   value="${resultMap.baseInfo.noticeTime}" autocomplete="off"
                                   onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})">
                        </td>
                        <th>公告号</th>
                        <td>
                            <input type="text" class="table-input productDataClass" name="noticeNum" maxlength="200"
                                   value="${resultMap.baseInfo.noticeNum}" readonly/>
                        </td>
                    </tr>
                    <tr>
                        <th>渠道出证时间</th>
                        <td>
                            <input type="text" disabled class="table-input Wdate" name="channelHisTime"
                                   value="${resultMap.baseInfo.channelHisTime}" autocomplete="off"
                                   onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})">
                        </td>
                        <th>领证时间</th>
                        <td>
                            <input type="text" disabled class="table-input Wdate" name="licensingTime"
                                   value="${resultMap.baseInfo.licensingTime}" autocomplete="off"
                                   onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})">
                        </td>
                        <th>渠道返点(元)</th>
                        <td>
                            <input type="text" class="table-input productDataClass" name="channelRebates" id="channelRebates" maxlength="13"
                                   value="${resultMap.baseInfo.channelRebates}" readonly onblur="isFloatRangeSam('#channelRebates',2,'99999999.99')"/>
                        </td>
                        <th>对外返点(元)</th>
                        <td>
                            <input type="text" class="table-input productDataClass" name="foreignRebates" id="foreignRebates" maxlength="13"
                                   value="${resultMap.baseInfo.foreignRebates}" readonly onblur="isFloatRangeSam('#foreignRebates',2,'99999999.99')"/>
                        </td>
                    </tr>
                    <tr>
                        <th>企业名称</th>
                        <td>
                            <input type="text" class="table-input productDataClass" name="companyName" maxlength="200"
                                   value="${resultMap.baseInfo.companyName}" readonly/>
                        </td>
                    </tr>
                    <tr>
                        <th>说明</th>
                        <td colspan="4">
                            <%--<textarea  class="textarea-class" readonly id="explains" name="explains" maxlength="" cols="76" rows="3"></textarea>--%>
                            <textarea class="textarea-style textarea-class productDataClass" rows="3" readonly id="explains" name="explains" placeholder="500字以内" >${resultMap.baseInfo.explains}</textarea>
                        </td>
                    </tr>
                    </tbody>
                </table>
                <%--每个业态单独的数据  其他通用 end--%>
            </form>
        </div>
    </div>
    <%--生产数据 end--%>

    <!--相关生产订单 start-->
    <c:if test="${not empty resultMap.relatedOrderList}">
        <div class="finan-panel">
            <div class="finan-tit">
                <b>相关生产订单</b>
            </div>
            <div class="panel-table">
                <table class="layui-table text-center">
                    <thead>
                    <th>序号</th>
                    <th>生产订单编号</th>
                    <th>生产状态</th>
                    <th>生产节点</th>
                    <th>产品类型</th>
                    <th>订单产品</th>
                    <th>业务地区</th>
                    <th>产品属性</th>
                    </thead>
                    <tbody>
                    <c:forEach var="relatedOrder" items="${resultMap.relatedOrderList}" varStatus="status">
                        <tr>
                            <td>${requestScope.offset+status.index+1}</td>
                            <td>
                                <c:if test="${relatedOrder.businessProductCode != 'BUS_YT_ZZ_ZS'}">
                                <a href="javascript:void(0)" class="layui-table-link "
                                   onclick="openOrderInfoDetail('${relatedOrder.scProductOrderNo}','${relatedOrder.id}')">${relatedOrder.scProductOrderNo}</a>
                                </c:if>
                                <c:if test="${relatedOrder.businessProductCode == 'BUS_YT_ZZ_ZS'}">
                                    ${relatedOrder.scProductOrderNo}
                                </c:if>
                            </td>
                            <td>${relatedOrder.status}</td>
                            <td>${relatedOrder.latestEndNodeName}</td>
                            <td>${relatedOrder.businessProductName}</td><!--产品类型-->
                            <td>${relatedOrder.productName}</td><!--产品-->
                            <td>${relatedOrder.serviceArea}</td><!--服务区域-->
                            <td class="line2" title="${relatedOrder.productAttr}">${relatedOrder.productAttr}</td><!--产品属性-->
                        </tr>
                    </c:forEach>
                    </tbody>
                </table>
            </div>
        </div>
    </c:if>
    <!--相关生产订单 end-->

    <!-- 历史记录等 start-->
    <div class="tab-panel layui-tab">
        <ul class=" layui-tab-title order-tab">
            <li class="layui-this">
                <a href="javascript:ChangeTab(1)">历史记录</a>
            </li>
            <li>
                <a href="javascript:ChangeTab(2)">客户信息</a>
            </li>
            <li>
                <a href="javascript:ChangeTab(3)">证书/资质</a>
            </li>
            <li>
                <a href="javascript:ChangeTab(4)">生产人员</a>
            </li>
            <li>
                <a href="javascript:ChangeTab(5)">签单信息</a>
            </li>
            <li>
                <a href="javascript:ChangeTab(6)">财务信息</a>
            </li>
            <li>
                <a href="javascript:ChangeTab(7)">外勤工单记录</a>
            </li>
            <%--<li>--%>
            <%--<a href="javascript:ChangeTab(7)">工单记录</a>--%>
            <%--</li>--%>
            <li>
                <a href="javascript:ChangeTab(8)">附件</a>
            </li>
            <li>
                <a href="javascript:ChangeTab(9)">企管家备注记录</a>
            </li>
        </ul>

    </div>
    <iframe src="${rootUrl}/zzsc/inprocess/product_order_history_records.html?scorderId=${resultMap.baseInfo.id}&&flowId=${resultMap.baseInfo.nodeFlowId}"
            id="scBaseInfoIframeId"
            name="scBaseInfoIframeName"
            width="100%" frameborder="0" scrolling="no" allowtransparency="yes"></iframe>
    <!--历史记录等 end-->



</div>
<c:import url="/WEB-INF/jsp/footer.jsp"/>
<script type="text/javascript" src="${rootUrl}/static/js/sc/orderInfo/orderInfo.js?v=${version}"></script>
<script type="text/javascript" src="${rootUrl}/static/js/zzsc/production/sc_common.js?v=${version}" charset="utf-8"></script>
<script type="text/javascript" src="${rootUrl}/static/js/zzsc/common/call_common.js?v=${version}" charset="utf-8"></script>
<script type="text/javascript" src="${rootUrl}/static/js/zzsc/inprocess/inprocess_list.js?v=${version}"></script>
<script type="text/javascript" src="${rootUrl}/static/js/zzsc/production/sc_receive.js?v=${version}" charset="utf-8"></script>
<script src="${rootUrl}/static/js/zzsc/common/sc_chooseUser.js?v=${version}" type="text/javascript" charset="utf-8"></script>
<script src="${rootUrl}/static/js/zzsc/common/layer.extend.js?v=${version}" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" src="${rootUrl}/static/js/zzsc/production/sc_auditorUser.js?v=${version}"></script>
<script src="${rootUrl}/static/js/zzsc/credential/credentailCommon/credentailCommon.js?v=${version}"></script>
</body>
<script type="text/javascript">
    dataTableReload=null;
    $(function () {
        var number = $("#cusPhone").val();
        var hidenumber=hidePhone(number);
        $("#hiddenNumber").html(hidenumber);
        areaLength($('#explains'),500);
        $("#productDataCom .Wdate").css('background-color','#dadada');//设置日期框背景颜色
        getQgjUser();
    });

    /**
     * 获取企管家用户
     */
    function getQgjUser() {
        var orderId= "${resultMap.baseInfo.orderId}";
        var businessTypeId= "${resultMap.baseInfo.businessTypeCode}";
        $.ajax({
            url: sysInfo.basePath + "/zzsc/inprocess/getQgjUser.do",
            data: {orderId: orderId,businessTypeId:businessTypeId},
            async: false,
            success: function (msg) {
                if (!isEmpty(msg.data)) {
                    $("#qgjUser").text(""+msg.data+"");
                }
            }
        })
    }

    //ifame切换
    function ChangeTab(index) {
        var url;
        //在iframe页面地址更改前，将iframe高度设置为0，清除上一个子页面高度的影响，google内核浏览器的高度才会自动缩减
        //document.getElementById("scBaseInfoIframeId").style.height = "0px";//最好设置为minHeight
        DGG.loading();
        if (index === 1) {//历史记录
            url = "/zzsc/inprocess/product_order_history_records.html?scorderId=${resultMap.baseInfo.id}" + "&&flowId=${resultMap.baseInfo.nodeFlowId}";
        }
        if (index === 2) {//客户信息
            url = "${ucApiUrl}/uc/customer/attr/detail.html?customerId=${resultMap.baseInfo.customerId}&typeCode=-1&isCanEdit=1";
        }
        if (index === 3) {//资质证书
            url = sysInfo.basePath + "/zzsc/inprocess/certificate_qualification_detail.html?scOrderId=${resultMap.baseInfo.id}";
        }
        if (index === 4) {//查协单人员等相关信息
            url = sysInfo.basePath + "/zzsc/inprocess/assist_info.html?scorderId=${resultMap.baseInfo.id}";
        }
        if (index === 5) {//签单信息
            url = "${orfApiUrl}/orf/order/iframeSign.do?orderId=${resultMap.baseInfo.orderId}";
        }
        if (index === 6) {//财务信息
            url = "${orfApiUrl}/orf/payment/payment_list.html?id=${resultMap.baseInfo.orderId}";
        }
        if (index === 7) {//工单信息
            url = "${scGdzxApiUrl}/gdzx/workOrder/workOrderForScProduct.html?scProductOrderId=${resultMap.baseInfo.id}";
        }
        if (index === 8) {//附件
            url = sysInfo.basePath + "/zzsc/inprocess/query_product_attachment_page.html?productOrderId=${resultMap.baseInfo.id}";
        }
        if (index === 9) {//企管家备注
            url = sysInfo.basePath + "/zzsc/inprocess/list_qgj_remark.html?orderId=${resultMap.baseInfo.orderId}";
        }
        $("#scBaseInfoIframeId").attr("src", url);
        DGG.loading('close');
    }

    //定时器调用设置页面高度
    startInit('scBaseInfoIframeId', 700);//页面底部ifame切换
    startInit('scNodeDataIframe', 200);//页面中间节点信息以及业务属性iframe

    var browserVersion = window.navigator.userAgent.toUpperCase();
    var isOpera = browserVersion.indexOf("OPERA") > -1 ? true : false;
    var isFireFox = browserVersion.indexOf("FIREFOX") > -1 ? true : false;
    var isChrome = browserVersion.indexOf("CHROME") > -1 ? true : false;
    var isSafari = browserVersion.indexOf("SAFARI") > -1 ? true : false;
    var isIE = (!!window.ActiveXObject || "ActiveXObject" in window);
    var isIE9More = (!-[1,] == false);

    //ifame自适应页面高度
    function reinitIframe(iframeId, minHeight) {
        try {
            var iframe = document.getElementById(iframeId);
            var bHeight = 0;
            if (isChrome == false && isSafari == false) {
                try {
                    bHeight = iframe.contentWindow.document.body.scrollHeight;
                } catch (ex) {
                }
            }
            var dHeight = 0;
            if (isFireFox == true)
                dHeight = iframe.contentWindow.document.documentElement.offsetHeight + 2;//如果火狐浏览器高度不断增加删除+2
            else if (isIE == false && isOpera == false && iframe.contentWindow) {
                try {
                    dHeight = iframe.contentWindow.document.documentElement.scrollHeight;
                } catch (ex) {
                }
            }
            else if (isIE == true && isIE9More) {//ie9+
                var heightDeviation = bHeight - eval("window.IE9MoreRealHeight" + iframeId);
                if (heightDeviation == 0) {
                    bHeight += 3;
                } else if (heightDeviation != 3) {
                    eval("window.IE9MoreRealHeight" + iframeId + "=" + bHeight);
                    bHeight += 3;
                }
            }
            else//ie[6-8]、OPERA
                bHeight += 3;

            var height = Math.max(bHeight, dHeight);
            if (height < minHeight) height = minHeight;
            //alert(iframe.contentWindow.document.body.scrollHeight + "~" + iframe.contentWindow.document.documentElement.scrollHeight);
            iframe.style.height = height + "px";
        } catch (ex) {
        }
    }



    //iframe自适应启动器
    function startInit(iframeId, minHeight) {
        eval("window.IE9MoreRealHeight" + iframeId + "=0");
        window.setInterval("reinitIframe('" + iframeId + "'," + minHeight + ")", 100);
    }

    function refreshNode() {
        document.getElementById("scNodeDataIframe").src = "/sc/general/scBaseInfo/queryScDataAndNode.html?id=${resultMap.baseInfo.id}&type=${resultMap.baseInfo.businessTypeId}";
    }
    function openRemark(customerId){
        window.parent.updateTab('备注详情',sysInfo.ucApiUrl+'/uc/new_customer_detail/get_customer_records_page.html?customerId='+customerId);
    }
    /**
     *  打开证书预匹配结果的按钮
     *  2018/8/28  14:09
     *  mqy
     **/
    function openAdvanceMatchingResult(obj,index) {
        var tr1d1 = $("input[name='tr1d1"+index+"']").val();
        var tr1d2 = $("input[name='tr1d2"+index+"']").val();
        var tr1d3 = $("input[name='tr1d3"+index+"']").val();
        var tr2d1 = $("input[name='tr2d1"+index+"']").val();
        var tr2d2 = $("input[name='tr2d2"+index+"']").val();
        var tr3d1 = $("input[name='tr3d1"+index+"']").val();
        var tr3d2 = $("input[name='tr3d2"+index+"']").val();
        var tr4d1 = $("input[name='tr4d1"+index+"']").val();



        var scOrderId = $("#scOrderId").val();
        var certificateTypeId = $("input[name='certificateTypeId"+index+"']").val();
        var certificateSpecialtyId =$("input[name='certificateSpecialtyId"+index+"']").val();
        var certificateLevel = $("input[name='certificateLevel"+index+"']").val();
        var isSocialSecurity = $("input[name='isSocialSecurity"+index+"']").val();
        var socialSecurityAreaId = $("input[name='socialSecurityAreaId"+index+"']").val();
        DGG.loading();
        $.post( sysInfo.basePath+"/zzsc/inprocess/certificate_advance_matching_result.html",
            {"scOrderId": scOrderId,"certificateTypeId": certificateTypeId,"certificateSpecialtyId":certificateSpecialtyId,
                "certificateLevel":certificateLevel,"isSocialSecurity":isSocialSecurity,"socialSecurityAreaId":socialSecurityAreaId,
                "tr1d1":tr1d1,"tr1d2":tr1d2,"tr1d3":tr1d3,
                "tr2d1":tr2d1,"tr2d2":tr2d2,
                "tr3d1":tr3d1,"tr3d2":tr3d2,
                "tr4d1":tr4d1,
            },
            function (data) {
            dgg.Open({
                content:data,
                title: '预匹配结果',
                area: ['1000px','600px'],
                btn:["取消"],
                yes:function (index) {
                    layer.close(index);
                    DGG.loading('close');
                }
            });
        },'html');

    }

    function advanceMatchingResult(certificateId,certificateNo,scOrderId,underOrderId) {
        var scOrderId = $("#scOrderId").val();
        DGG.Confire("确定匹配此证书吗？", '匹配证书', function () {
            DGG.loading();
            $.ajax({
                type: 'POST',
                async: true,
                data: {'certificateId':certificateId,'certificateNo':certificateNo,'scOrderId':scOrderId,'underOrderId':underOrderId},
                url: sysInfo.basePath + '/zzsc/inprocess/save_certificate_advance_and_match_certificate.do',
                dataType: 'JSON',
                success: function (data) {
                    if (data.code == 0) {
                        layer.closeAll();
                        DGG.Succeed('操作成功！')
                        DGG.loading('close');
                        window.location.reload();
                    } else {
                        DGG.Errors(data.msg);
                        DGG.loading('close');
                    }
                },
                error: function () {
                    DGG.Errors('保存失败，请联系管理员！！');
                }
            })
        })
    }
</script>
</html>
